import request from '@/utils/request';

//查询公司
export function companyList() {
    return request({
        url: '/company/',
        method: 'get',
    })
}

//创建公司
export function creatCompany(data) {
    return request({
        url: '/company/',
        method: 'post',
        data:data,
    })
}

//查看公司管理员
export function companyAdministrators(id) {
    return request({
        url: `/company/${id}/look_super/`,
        method: 'get',
    })
}

//申请加入
export function joinCompany(id) {
    return request({
        url: `/company/${id}/join`,
        method: 'get',
    })
}

//查看公司员工
export function lookCompanyStaff(countNum,pageNum,data) {
    return request({
        url: `section/operation/query_employee/?size=${countNum}&page=${pageNum}`,
        method: 'post',
        data:data,
    })
}

//查看公司所有员工
export function lookCompanyStaffAll(countNum,pageNum,id) {
    return request({
        url: `/section/${id}/employee/?size=${countNum}&page=${pageNum}`,
        method: 'get',
    })
}

//查看申请加入公司的员工
export function lookAddCompanyStaff(countNum,pageNum) {
    return request({
        url: `/company/operation/look_not_approve/?size=${countNum}&page=${pageNum}`,
        method: 'get',
    })
}

//查看历史审批加入公司的记录
export function lookAddCompanyApproval(countNum,pageNum) {
    return request({
        url: `/company/operation/look_approve/?size=${countNum}&page=${pageNum}`,
        method: 'get',
    })
}

//审批用户加入公司
export function approvalUserCompany(data) {
    return request({
        url: `/company/operation/approve_join/`,
        method: 'post',
        data:data
    })
}

//将用户踢出公司
export function userRemoveCompany(id) {
    return request({
        url: `/company/operation/${id}/remove/`,
        method: 'get',
    })
}